package cn.cjp.m3d27;

public class jperson implements Comparable<jperson>{

    int age;

    public jperson() {
    }

    public jperson(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "jperson{" +
                "age=" + age +
                '}';
    }

    //重写排序guiz
    @Override
    public int compareTo(jperson o) {
        //根据年龄升序
        return this.getAge()-o.getAge();
    }
}
